package com.ray.feign;

import com.ray.entity.Student;
import com.ray.feign.impl.FeignError;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Collection;

//申明式接口，不需要restTemplate fallback,如果provider服务器出现错误将，降级调用FeignError实现类提供的方法
@FeignClient(value = "provider",fallback = FeignError.class)
public interface FeignProviderClient {

    @GetMapping("/student/findAll")
    public Collection<Student> findAll();

    @GetMapping("/student/index")
    public String index();
}
